﻿<UserControl x:Class="Oddo.Concept.Crm.Common.Presentation.Views.BaseView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
             xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" 
             xmlns:local="clr-namespace:Oddo.Concept.Crm.Common.Presentation.Views"
             xmlns:resources="clr-namespace:Oddo.Concept.Crm.Common.Presentation.Resources"
             xmlns:controls="clr-namespace:Oddo.Concept.Crm.Common.Presentation.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="337" 
             d:DesignWidth="780">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <dxb:BarManager x:Name="BarManager" MDIMergeStyle="Never">
            <dxb:BarManager.Items>
                <dxb:BarButtonItem Content="{x:Static resources:Labels.label_button_search}" x:Name="BarButtonItemSearch" Command="{Binding SearchCommand}" ToolTip="{x:Static resources:Labels.tooltip_button_search}" BarItemDisplayMode="ContentAndGlyph" Glyph="/Oddo.Concept.Crm.Common.Presentation;component/Images/search_16.png" />
                <dxb:BarButtonItem Content="{x:Static resources:Labels.label_button_reset}" x:Name="BarButtonItemReset" Command="{Binding ResetCriteriasCommand}" ToolTip="{x:Static resources:Labels.tooltip_button_reset}" BarItemDisplayMode="ContentAndGlyph" Glyph="/Oddo.Concept.Crm.Common.Presentation;component/Images/reset_16.png"/>
                <dxb:BarButtonItem Content="{x:Static resources:Labels.label_button_add}" x:Name="BarButtonItemAdd" Command="{Binding AddCommand}" ToolTip="{x:Static resources:Labels.tooltip_button_add}" BarItemDisplayMode="ContentAndGlyph" Glyph="/Oddo.Concept.Crm.Common.Presentation;component/Images/add_16.png"/>
                <dxb:BarButtonItem Content="{x:Static resources:Labels.label_button_edit}" x:Name="BarButtonItemEdit" Command="{Binding EditCommand}" ToolTip="{x:Static resources:Labels.tooltip_button_edit}" BarItemDisplayMode="ContentAndGlyph" Glyph="/Oddo.Concept.Crm.Common.Presentation;component/Images/edit_16.png"/>
                <dxb:BarButtonItem Content="{x:Static resources:Labels.label_button_delete}" x:Name="BarButtonItemDelete" Command="{Binding DeleteCommand}" ToolTip="{x:Static resources:Labels.tooltip_button_delete}" BarItemDisplayMode="ContentAndGlyph" Glyph="/Oddo.Concept.Crm.Common.Presentation;component/Images/delete_16.png"/>
            </dxb:BarManager.Items>
            <dxb:BarManager.Bars>
                <dxb:Bar x:Name="EditBar" Caption="Edit bar">
                    <dxb:Bar.DockInfo>
                        <dxb:BarDockInfo />
                    </dxb:Bar.DockInfo>
                    <dxb:BarButtonItemLink BarItemName="BarButtonItemAdd" />
                    <dxb:BarButtonItemLink BarItemName="BarButtonItemEdit" />
                    <dxb:BarButtonItemLink BarItemName="BarButtonItemDelete" />
                </dxb:Bar>
                <dxb:Bar x:Name="SearchBar" Caption="Search bar">
                    <dxb:Bar.DockInfo>
                        <dxb:BarDockInfo />
                    </dxb:Bar.DockInfo>
                    <dxb:BarButtonItemLink BarItemName="BarButtonItemSearch"  />
                    <dxb:BarButtonItemLink BarItemName="BarButtonItemReset" />
                </dxb:Bar>
            </dxb:BarManager.Bars>
            <dxlc:LayoutControl x:Name="MainLayoutControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Orientation="Vertical" Padding="3">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <dxlc:LayoutGroup Grid.Row="0" x:Name="SearchCriteriaLayoutGroup" Header="{x:Static resources:Labels.label_search_criterias}" View="GroupBox" HorizontalAlignment="Stretch" IsCollapsible="True" IsCollapsed="False" DataContext="{Binding FindRequest}">
                        <ContentControl Content="{Binding SearchCriteriaContent, RelativeSource={RelativeSource AncestorType=local:BaseView}}"></ContentControl>
                    </dxlc:LayoutGroup>
                    <ContentControl Grid.Row="1" Content="{Binding MainContent, RelativeSource={RelativeSource AncestorType=local:BaseView}}"/>
                </Grid>
            </dxlc:LayoutControl>
        </dxb:BarManager>
        <!--Busy panel -->
        <controls:BusyPanel x:Name="busyPanel" Style="{StaticResource BusyPanelStyle}"></controls:BusyPanel>
    </Grid>
</UserControl>

<!--BusyText="{x:Static resources:Labels.label_busy}" CancelButtonText="{x:Static resources:Labels.label_cancel}"-->
